/*
 * symbol_table.h
 *
 *  Created on: Nov 25, 2010
 *      Author: cpy.prefers.you@gmail.com
 */

#ifndef SYMBOL_TABLE_H_
#define SYMBOL_TABLE_H_

#include "headers.h"

#define HASH_TABLE_SIZE 65537 //Prime[6543]

typedef struct SymbolType
{
    char *Name;
    int Type;

    /* for keywords */
    int KeywordType;

    /* for identifiers */
    struct SymbolType *StorageClass;
    struct SymbolType *ModifierOfLen;
    struct SymbolType *ModifierOfSign;
    struct SymbolType *Qualifier;
    struct SymbolType *DataType;
    struct SymbolType *Value;
    
    /* for operators */
    /* function pointer lists here */
    
    /* for functions */
    /* return values and parameter lists here */
    
    /* for pointers */
    int PointerLevel;

    struct SymbolType *Next;
}   Symbol_T;

extern Symbol_T *NewSymbol();
extern Symbol_T *InsertSymbol(Symbol_T *Symbol);
extern Symbol_T *LookupName(char *Name);
extern void SymbolTableInit();
extern void RemoveSymbol(char *Name);
extern int MemSize(int Type);

#endif /* SYMBOL_TABLE_H_ */
